//
//  RootHeadView.m
//  zxjxc
//
//  Created by fcy on 15/9/2.
//  Copyright (c) 2015年 fcy. All rights reserved.
//

#import "RootHeadView.h"

@implementation RootHeadView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(void)initWithTitle:(NSString *)title img:(NSString *)imgname Expand:(BOOL)isexpad
{
    _labelTitle.text = title;
    [_imgIcon setImage:[UIImage imageNamed:imgname]];
    if (isexpad) {
        [_imgArrow setImage:[UIImage imageNamed:@"icon_array_right_red"]];
    }
    else
    {
        [_imgArrow setImage:[UIImage imageNamed:@"icon_array_up_red"]];
    }
}
-(void)setIsExpand:(BOOL)isExpand
{
    _isExpand = isExpand;
    if (_isExpand) {
        [_imgArrow setImage:[UIImage imageNamed:@"icon_array_up_red"]];
    }
    else
    {
        [_imgArrow setImage:[UIImage imageNamed:@"icon_array_right_red"]];
    }
}
-(void)setIsOpend:(BOOL)isOpend
{
    _isOpend = isOpend;
    if (_isOpend) {
        [_imgArrow setImage:[UIImage imageNamed:@"icon_array_down_red"]];
        self.backgroundColor = [UIColor grayColor];
        self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
    }
    else
    {
        [_imgArrow setImage:[UIImage imageNamed:@"icon_array_up_red"]];
        self.backgroundColor = [UIColor clearColor];
    }
}



@end
